import request from '_c/utils/request'


/**
 * 终端激活
 */
export function termActiveList(data) {
	return request({
		url: '/api/ag/merch/activation/check/list',
		method: 'GET',
		params: data
	})
}

/**
 * 终端绑定记录
 */
export function termTotal(data) {
	return request({
		url: '/api/ag/app/total/term/policy',
		method: 'GET',
		params: data
	})
}

/**
 * 终端列表
 */
export function termList(data) {
	return request({
		url: '/api/ag/term/list',
		method: 'GET',
		params: data
	})
}

/**
 * 平行代理终端列表
 */
export function preTermList(data) {
	return request({
		url: '/api/ag/pre/term/list',
		method: 'GET',
		params: data
	})
}


/**
 * 可下发终端列表
 */
export function canAssginList(data) {
	return request({
		url: '/api/ag/term/can/assgin/list',
		method: 'GET',
		params: data

	})
}
/**
 * 可回收终端列表
 */
export function canRecycleList(data) {
	return request({
		url: '/api/ag/term/can/recycle/list',
		method: 'GET',
		params: data

	})
}

/**
 * 可回拨终端列表
 */
export function callbackList(data) {
	return request({
		url: '/api/ag/term/can/callback/list',
		method: 'GET',
		params: data

	})
}

/**
 * 终端划拨
 * @param serialno
 */
export function assign(data) {
	return request({
		url: '/api/ag/term/operate/assign',
		method: 'POST',
		data,
		noShowMsg: true

	})
}
/**
 * 终端回收 
 * @param serialno
 */
export function recycle(data) {
	return request({
		url: '/api/ag/term/operate/recycle',
		method: 'POST',
		data,
		noShowMsg: true
	})
}
/**
 * 终端回拨
 * @param serialno
 */
export function callback(data) {
	return request({
		url: '/api/ag/term/operate/callback',
		method: 'POST',
		data,
		noShowMsg: true
	})
}

/**
 * 终端绑定
 * @param serialno
 */
export function termBind(data) {
	return request({
		url: '/app/api/user/bind/term/add',
		method: 'POST',
		data,
		noShowMsg: true
	})
}
/**
 * 终端解绑
 * @param serialno
 */
export function termUnBind(data) {
	return request({
		url: '/api/ag/term/operate/unbind',
		method: 'POST',
		data,
		noShowMsg: true
	})
}


/**
 * 终端绑定记录
 */
export function termBindList() {
	return request({
		url: '/app/api/user/bind/term/list',
		method: 'GET'
	})
}

/**
 * 终端操作记录
 */
export function termOperatList(data) {
	return request({
		url: '/api/ag/term/handle/list',
		method: 'GET',
		params: data
	})
}



/**
 * 服务费列表
 */
export function serviceList(data) {
	return request({
		url: '/api/ag/active/mapChannel/list',
		method: 'GET',
		params: data
	})
}

// 查询终端可修改的服务费列表
export function canChangeServiceFeeList(query) {
	return request({
		url: '/api/ag/change/serviceFee/query',
		method: 'get',
		params: query
	})
}

// 查询终端可修改的通讯费列表
export function canChangeCommFeeList(query) {
	return request({
		url: '/api/ag/change/serviceFee/queryCommonfeeList',
		method: 'get',
		params: query
	})
}

//申请修改终端服务费
export function changeServiceFeeApply(data) {
	return request({
		url: '/api/ag/change/serviceFee/apply',
		method: 'post',
		data
	})
}

//申请修改终端通讯费
export function changeCommFeeApply(data) {
	return request({
		url: '/api/ag/change/serviceFee/editCommFee',
		method: 'post',
		data
	})
}

// 查询终端通讯费信息
export function queryCommonfeeInfo(query) {
  return request({
    url: '/api/ag/change/serviceFee/queryCommonfeeInfo',
    method: 'get',
    params: query
  })
}


// 修改服务费列表记录
export function changeServiceFeeHistory(query) {
	return request({
		url: '/api/ag/change/serviceFee/list',
		method: 'get',
		params: query
	})
}


// 终端回拨确认列表
export function backConfirmList(query) {
	return request({
		url: '/api/ag/term/backConfirm/list',
		method: 'get',
		params: query
	})
}
//终端确认回拨
export function operateCallbackConfirm(data) {
	return request({
		url: '/api/ag/term/operate/callbackConfirm',
		method: 'post',
		data
	})
}
//终端品牌列表
export function brandList(data) {
	return request({
		url: '/api/ag/term/brand/list',
		method: 'get',
		params: data
	})
}
//代理端修改终端所属品牌(接口更改为修改终端渠道) /api/ag/term/editTermBrand
export function editTermBrand(data) {
	return request({
		url: '/api/ag/term/editTermChannel',
		method: 'get',
		params: data
	})
}

//获取处理后的机具号
export function getLoginSn(data) {
	return request.request({
		url: '/app/api/scan/getLoginSn?sn=' + data,
		method: 'get',
	})
}

//获取机具二维码
export function getTermQRCode(data) {
	return request.request({
		url: '/api/ag/term/getQRCode?sn=' + data,
		method: 'get',
		params: data
	})
}